package com.ddz.model;

public class User {
    private final String userId;
    private final String password;
    private String nickname;
    private int score=0;
    private String roomid;
    private int order;

    public User(String userId, String password) {
        this.userId = userId;
        this.password = password;
    }

    public User(String userId, String password, String nickname) {
        this.userId = userId;
        this.password = password;
        this.nickname = nickname;
    }

    public String getUserId() {
        return userId;
    }

    public String getPassword() {
        return password;
    }

    public String getNickname() {
        return nickname;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getRoomid() {
        return roomid;
    }

    public void setRoomid(String roomid) {
        this.roomid = roomid;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String tojson(){
        return "{" +
                "\"userId\":\"" + userId + '\"' +
                ", \"username\":\"" + nickname + '\"' +
                ", \"roomid\":\"" + roomid + '\"' +
                ", \"score\":" + score +
                ", \"order\":" + order +
                "}";
    }

    @Override
    public String toString() {
        return "User{" +
                "userId='" + userId + '\'' +
                ", username='" + nickname + '\'' +
                ", password='" + password + '\'' +
                ", roomid='" + roomid + '\'' +
                ", score=" + score +
                '}';
    }
}